package com.wuxf.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.alibaba.fastjson.JSONArray;
import com.wuxf.entity.DicDataInfo;
import com.wuxf.service.DicDataService;

@Controller
@SuppressWarnings({"rawtypes","unchecked"})
@RequestMapping("gather")
public class GatherController {
	@Autowired
	private DicDataService dicDataService;
	
	
	@RequestMapping("goToSubmit")
	public String goToSubmit(Model model) {
		List<DicDataInfo> typeDicDatas = dicDataService.findByEnumTypeId("1");
		List<DicDataInfo> areaDicDatas = dicDataService.findByEnumTypeId("2");
		List<DicDataInfo> unitDicDatas = dicDataService.findByEnumTypeId("4");
		model.addAttribute("typeDicDatas", JSONArray.toJSONString(typeDicDatas));
		model.addAttribute("areaDicDatas", JSONArray.toJSONString(areaDicDatas));
		model.addAttribute("unitDicDatas", JSONArray.toJSONString(unitDicDatas));
		model.addAttribute("typeDicDataArr", typeDicDatas);
		model.addAttribute("areaDicDataArr", areaDicDatas);
		model.addAttribute("unitDicDataArr", unitDicDatas);
		return "gather/submit";
	}
	
	
	
	
}
